package com.kedeng.yangmuyi.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @ClassName: BaseDO
 * @Description: all the DO must extend this BaseDO include the common necessary
 *               property.
 * @author rqian
 * @date Jul 3, 2013 5:21:23 PM
 * 
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
@Table(name="TBaseInfo")
public class BaseDO implements Serializable {

    private static final long serialVersionUID = -6264948064733532172L;

    @GenericGenerator(name = "generator", strategy = "increment")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "ID", unique = true, nullable = false)
    private long              id;
    @Temporal(TemporalType.TIMESTAMP)
    @Column
    private Date              date;
    @Column
    private int               version;
    @Column
    private String            status;



    public BaseDO() {

    }



    public BaseDO(long id, Date date, int version, String status) {
        super();
        this.id = id;
        this.date = date;
        this.version = version;
        this.status = status;
    }



    /**
     * @return the id
     */
    public long getId() {
        return id;
    }



    /**
     * @param id
     *            the id to set
     */
    public void setId(long id) {
        this.id = id;
    }



    /**
     * @return the date
     */
    public Date getDate() {
        return date;
    }



    /**
     * @param date
     *            the date to set
     */
    public void setDate(Date date) {
        this.date = date;
    }



    /**
     * @return the version
     */
    public int getVersion() {
        return version;
    }



    /**
     * @param version
     *            the version to set
     */
    public void setVersion(int version) {
        this.version = version;
    }



    /**
     * @return the status
     */
    public String getStatus() {
        return status;
    }



    /**
     * @param status
     *            the status to set
     */
    public void setStatus(String status) {
        this.status = status;
    }

}
